#include "N1Memory.h"
#include "N1MLT.h"
#include <new>

void* N1Malloc(size_t size)
{
    void* ptr = malloc(size);

    if(!ptr)
    {
        throw std::bad_alloc();
    }
#ifdef N1MLT
    N1MLT_OnAlloc(ptr);
#endif

    return ptr;
}

void N1Free(void *memblock)
{
    if(memblock)
    {
#ifdef N1MLT
        N1MLT_OnFree(memblock);
#endif
        free(memblock);
    }
}
